package cn.bdqn.service;

/**
 * 2018/9/20
 */
public interface TokenService {
    /**
     * 生成token
     * @param userAgent
     * @param o
     * @return
     *          PC：“PHONE-USERID-CREATIONDATE”
     */
    public String getToken(String userAgent, Object o);


    /**
     * 保存token到redis
     * @param token
     * @param o
     */
    public void save(String token,Object o);



    /**
     * 验证token
     * @param agent
     * @param token
     * @return
     */
    public boolean validaty(String agent,String token);



    /**
     * 删除token
     * @param token
     * @return
     */
    public boolean deleteToken(String token);



    /**
     * 刷新token
     * @param agent
     * @param token
     * @return
     * @throws Exception
     */
    public String reload(String agent,String token) throws Exception;
}
